home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / graphics / mfpic / misc / rotgroup.tex < prev   
Text File  |  1992-11-25  |  958b  |  35 lines

  1. % rotgroup.tex - version 2 for mfpic 0.2 - 06:31 GMT Thu 26 Nov 1992.
  2. % author - Geoffrey Tobin (ecsgrt@luxor.latrobe.edu.au)
  3. %
  4. % rotgroup, endrotgroup
  5. % - Rotate mfpic coordinate system about centre #1 by #2 degrees.
  6. %
  7. % Any Metafont pair valued expression may be substituted for #1,
  8. % and any numeric valued expression for #2.
  9. % A pair is a pair of numerics, e.g.  (2.71, 3.141)  ;
  10. % Numerics may be integer or real, but their magnitudes must be
  11. % strictly less than 4096.
  12. %
  13. % Experiment to discover the sign of the rotation.
  14. %
  15. % NB:  Use this code inside an mfpic picture environment.
  16. %
  17. \def\rotgroup#1#2{%
  18. \mfcmd
  19. {
  20. begingroup
  21.   save old_ztr;    % in case old_ztr's already defined.
  22.   transform old_ztr;
  23.   old_ztr := ztr;
  24.   save ztr;        % lose old value and type of ztr.
  25.   ztr := old_ztr rotatedabout (#1, #2);
  26.   % metafont knows LHS must be a transform, b/c RHS is one.
  27. }%
  28. }
  29. \def\endrotgroup{%
  30. \mfcmd
  31. {
  32. endgroup;    % restore all grouped saves.
  33. }%
  34. }
  35.